﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for EThanhVien
/// </summary>
public class EThanhVien
{
    private string tenDangNhap;
    private string matKhau;
    private string tenKH;
    private string email;
    private DateTime ngaySinh;
    private string cmnd;
    private string diaChi;
    private string dienThoai;
    private string activeCode;
    private bool trangThai;
    public EThanhVien()
    { }
    public EThanhVien(string tenDangNhap, string matKhau, string tenKH, string email, DateTime ngaySinh,string cmnd, string diaChi, string dienThoai, string activeCode, bool trangThai)
    {
        this.tenDangNhap = tenDangNhap;
        this.matKhau = matKhau;
        this.tenKH = tenKH;
        this.email = email;
        this.ngaySinh = ngaySinh;
        this.diaChi = diaChi;
        this.dienThoai = dienThoai;
        this.activeCode = activeCode;
        this.trangThai = trangThai;
        this.cmnd = cmnd;
    }
    public string TenDangNhap
    {
        get { return this.tenDangNhap; }
        set
        {
            if (value == null)
                throw new Exception("tenDangNhap not allow nullvalue.");
            this.tenDangNhap = value;
        }
    }
    public string CMND
    {
        get { return this.cmnd; }
        set
        {
            if (value == null)
                throw new Exception("CMND not allow nullvalue.");
            this.cmnd = value;
        }
    }
    public string MatKhau
    {
        get { return this.matKhau; }
        set
        {
            if (value == null)
                throw new Exception("matKhau not allow nullvalue.");
            this.matKhau = value;
        }
    }
    public string TenKH
    {
        get { return this.tenKH; }
        set { this.tenKH = value; }
    }
    public string Email
    {
        get { return this.email; }
        set { this.email = value; }
    }
    public DateTime NgaySinh
    {
        get { return this.ngaySinh; }
        set { this.ngaySinh = value; }
    }
    public string DiaChi
    {
        get { return this.diaChi; }
        set { this.diaChi = value; }
    }
    public string DienThoai
    {
        get { return this.dienThoai; }
        set { this.dienThoai = value; }
    }
    public string ActiveCode
    {
        get { return this.activeCode; }
        set { this.activeCode = value; }
    }

    public bool TrangThai
    {
        get { return trangThai; }
        set { trangThai = value; }
    }
    public override string ToString()
    {
        return this.tenDangNhap + "; " + this.matKhau + "; " + this.tenKH + "; " + this.email + "; " + this.ngaySinh + "; "+this.cmnd+";" + this.diaChi + "; " + this.dienThoai + "; " + this.activeCode + "; " + this.trangThai + "; ";
    }
    public override bool Equals(Object obj)
    {
        EThanhVien me = (EThanhVien)obj;
        bool ret = this.TenDangNhap.Equals(me.TenDangNhap);
        return ret;
    }
    public override int GetHashCode()
    {
        return this.TenDangNhap.GetHashCode();
    }

}